package org.a025;

import java.util.Random;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

public class T06_ArrayBlockingQueue {
	static Random r = new Random();
	static BlockingQueue<String> strs = new ArrayBlockingQueue<>(10);

	public static void main(String[] args) throws InterruptedException {
		for(int i=0;i<10;i++){
			strs.put("a"+i);
		}
//		strs.put("aaa");
//		strs.add("aaa");
		//有位置就加，没位置就不加了
		strs.poll();
		strs.offer("aaa");
		System.out.println(strs);
	}
}
